<html>
<body>
  <form><input type="text" id="search" /></form>
  <script type="text/javascript">
    document.getElementById("search").setAttribute("type","search");
  </script>
</body>
</html>